$(document).ready(function() {
						   
	//编写一个函数类下当链接点击弹出				   
	$('a.popup').click(function() {
										
		//window.parent.scrollTo(0,110);    //控制滚动条的坐标
											
		// Here we will describe a variable popupid which gets the
		// rel attribute from the clicked link
		//将描述一个变量popuid的rel属性都从点击链接							
		var popupid = $(this).attr('rel');
		
		// Now we need to popup the marked which belongs to the rel attribute
		//现在我们需要弹出属于rel属性的标记
		// Suppose the rel attribute of click link is popuprel then here in below code
		//假设的rel属性点击链接popuprel然后在下面代码
		// #popuprel will fadein
		$('#' + popupid).fadeIn();
		
		// append div with id fade into the bottom of body tag
		//添加id为fade的div到body底部的标签
		// and we allready styled it in our step 2 : CSS
		
		$('body').append('<div id="fade"></div>');
		$('#fade').css({'opacity':'0.3'}).fadeIn();
	
		// Now here we need to have our popup box in center of 
		//现在我们需要弹出框在网页居中
		// webpage when its fadein. so we add 10px to height and width
		//当网页渐显时，所以我们添加10 px高度和宽度 
		var popuptopmargin = ($('#' + popupid).height() + 10) / 2;
		var popupleftmargin = ($('#' + popupid).width()) / 2;
		
		
		//使用css样式使弹出框中心对齐
		$('#' + popupid).css({
			'margin-top' : -popuptopmargin,
			'margin-left' : -popupleftmargin
			});
	});
	
	
	// Now define one more function which is used to fadeout the 
	// fade layer and popup window as soon as we click on fade layer
	$('#fade').click(function() {
	
		// 清除遮罩与弹出层 						  
		$('#fade , #popuprel  , #popupbox_addEdit').fadeOut()
		return false;
	});

	$('.cancel').click(function() {

		// 清除遮罩与弹出层 	 						  
		$('#fade , #popuprel , #popupbox_addEdit').fadeOut()
		return false;
	});
});